package org.gw.ylc.base.data;

import org.gw.ylc.base.util.StringArrayUtil;

import java.util.List;

public class JoinQuery {
	public String slaveProperty;
	public String masterProperty;

	public String entity;
	public String alias;
	public List<Condition> conditions;
	private boolean isMany;

	public JoinQuery() {
	}

	public String getSlaveProperty() {
		return slaveProperty;
	}

	public void setSlaveProperty(String slaveProperty) {
		this.slaveProperty = slaveProperty;
	}

	public String getMasterProperty() {
		return masterProperty;
	}

	public void setMasterProperty(String masterProperty) {
		this.masterProperty = masterProperty;
	}

	public String getEntity() {
		return entity;
	}

	public void setEntity(String entity) {
		this.entity = entity;
	}

	public String getAlias() {
		if (alias == null) {
			alias = StringArrayUtil.lowerCaseFirst(entity);
		}
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public List<Condition> getConditions() {
		return conditions;
	}

	public void setConditions(List<Condition> conditions) {
		this.conditions = conditions;
	}

	public boolean isMany() {
		return isMany;
	}

	public void setMany(boolean isMany) {
		this.isMany = isMany;
	}

}